package com.icarus.quartz.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

import com.icarus.quartz.service.QuartzManager;

/**
 * spring容器初始化完成后初始化定时任务
 * 
 * @author huayun-win10
 *
 */
@Component
public class QuartzInitservice implements
		ApplicationListener<ContextRefreshedEvent> {

	@Autowired
	private QuartzManager quartzManager;

	@Override
	public void onApplicationEvent(ContextRefreshedEvent event) {
		System.out.println("初始化定时任务");
		quartzManager.init();
		System.out.println("定时任务初始化完成");
	}

}
